﻿using AspectCore.Configuration;
using AspectCore.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using xiaodingmarket_application.Service;
using xiaodingmarket_service.Cache;
using xiaodingmarket_service.Controllers;

namespace xiaodingmarket_service.Configurations
{
    public static class AspectCoreExtensions
    {
		public static void ConfigAspectCore(this IServiceCollection services)
		{
			services.ConfigureDynamicProxy(config =>
			{
				//注册拦截器
				config.Interceptors.AddTyped<CacheAbleInterceptor>(Predicates.Implement(typeof(redisTest)));
			});
			services.BuildAspectInjectorProvider();
		}
	}
}
